<template>
  <el-dialog title="导入" :visible.sync="visible" width="680px" append-to-body @close="onClose">
    <FileUpload v-model="file" :limit="1" />
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submitForm">确 定</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div>
  </el-dialog>
</template>
<script>
import FileUpload from "@/components/FileUpload/index.vue";
export default {
  name: "import-modal",
  components: {
    FileUpload
  },
  props: {
    value: {
      type: Boolean,
      default: false
    },
  },
  data() {
    return {
      file: null
    }
  },
  computed: {
    visible: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  },
  methods: {
    onClose() {
      this.file = null
    },
    submitForm() {
      console.log('submit')
      this.cancel()
    },
    cancel() {
      this.visible = false
    }
  }
}
</script>
<style scoped lang="scss">

</style>
